﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Decoration.Models.Models
{
    public class Base_LoginInfo
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }

        [ForeignKey(nameof(UserId))]
        public int UserId { get; set; }

        /// <summary>
        /// 登录名
        /// </summary>
        [MaxLength(50)]
        public string LoginName { get; set; } = null!;

        /// <summary>
        /// 登录密码
        /// </summary>
        [MaxLength(50)]
        public string LoginPwd { get; set; } = null!;

        /// <summary>
        /// 登录次数
        /// </summary>
        public int LoginCount { get; set; } = 0;

        public DateTime? LoginLastTime { get; set; }

        public DateTime CreateTime { get; set; } = DateTime.Now;

        public int Status { get; set; } = 1;

        /// <summary>
        /// 微信的OpenId
        /// </summary>
        public string? OpenId { get; set; }

        /// <summary>
        /// 头像
        /// </summary>
        public string? ProfilePhoto { get; set; }

        public virtual Base_UserInfo User { get; set; } = null!;
    }
}
